home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / DriverServices.p < prev    next >
Encoding:
Text File  |  1996-09-22  |  7.4 KB  |  160 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        DriverServices.p
  3.  
  4.      Contains:    Driver Services Interfaces.
  5.  
  6.      Version:    Technology:    PowerSurge 1.0.2.
  7.                  Package:    Universal Interfaces 2.1.4
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT DriverServices;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __DRIVERSERVICES__}
  30. {$SETC __DRIVERSERVICES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC DriverServicesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36. {$IFC UNDEFINED __CONDITIONALMACROS__}
  37. {$I ConditionalMacros.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __TYPES__}
  40. {$I Types.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __KERNEL__}
  43. {$I Kernel.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __DEVICES__}
  46. {$I Devices.p}
  47. {$ENDC}
  48.  
  49. {$PUSH}
  50. {$ALIGN MAC68K}
  51. {$LibExport+}
  52.  
  53.  
  54. TYPE
  55.     DeviceLogicalAddressPtr                = ^LogicalAddress;
  56.  
  57. CONST
  58.     durationMicrosecond            = -1;                            {  Microseconds are negative }
  59.     durationMillisecond            = 1;                            {  Milliseconds are positive }
  60.     durationSecond                = 1000;                            {  1000 * durationMillisecond }
  61.     durationMinute                = 60000;                        {  60 * durationSecond, }
  62.     durationHour                = 3600000;                        {  60 * durationMinute, }
  63.     durationDay                    = 86400000;                        {  24 * durationHour, }
  64.     durationNoWait                = 0;                            {  don't block }
  65.     durationForever                = $7FFFFFFF;                    {  no time limit }
  66.  
  67.     k8BitAccess                    = 0;                            {  access as 8 bit }
  68.     k16BitAccess                = 1;                            {  access as 16 bit }
  69.     k32BitAccess                = 2;                            {  access as 32 bit }
  70.  
  71.  
  72. TYPE
  73.     Nanoseconds                            = UnsignedWide;
  74.     NanosecondsPtr                         = ^Nanoseconds;
  75.     
  76. FUNCTION IOCommandIsComplete(ID: IOCommandID; result: OSErr): OSErr; C;
  77. FUNCTION GetIOCommandInfo(ID: IOCommandID; VAR contents: IOCommandContents; VAR command: IOCommandCode; VAR kind: IOCommandKind): OSErr; C;
  78. PROCEDURE BlockCopy(srcPtr: UNIV Ptr; destPtr: UNIV Ptr; byteCount: Size); C;
  79. FUNCTION PoolAllocateResident(byteSize: ByteCount; clear: BOOLEAN): LogicalAddress; C;
  80. FUNCTION PoolDeallocate(address: LogicalAddress): OSStatus; C;
  81. FUNCTION GetLogicalPageSize: ByteCount; C;
  82. FUNCTION GetDataCacheLineSize: ByteCount; C;
  83. FUNCTION FlushProcessorCache(spaceID: AddressSpaceID; base: LogicalAddress; length: ByteCount): OSStatus; C;
  84. PROCEDURE SynchronizeIO; C;
  85. FUNCTION MemAllocatePhysicallyContiguous(byteSize: ByteCount; clear: BOOLEAN): LogicalAddress; C;
  86. FUNCTION MemDeallocatePhysicallyContiguous(address: LogicalAddress): OSStatus; C;
  87. FUNCTION UpTime: AbsoluteTime; C;
  88. PROCEDURE GetTimeBaseInfo(VAR minAbsoluteTimeDelta: UInt32; VAR theAbsoluteTimeToNanosecondNumerator: UInt32; VAR theAbsoluteTimeToNanosecondDenominator: UInt32; VAR theProcessorToAbsoluteTimeNumerator: UInt32; VAR theProcessorToAbsoluteTimeDenominator: UInt32); C;
  89. FUNCTION AbsoluteToNanoseconds(absoluteTime: AbsoluteTime): Nanoseconds; C;
  90. FUNCTION AbsoluteToDuration(absoluteTime: AbsoluteTime): Duration; C;
  91. FUNCTION NanosecondsToAbsolute(nanoseconds: Nanoseconds): AbsoluteTime; C;
  92. FUNCTION DurationToAbsolute(duration: Duration): AbsoluteTime; C;
  93. FUNCTION AddAbsoluteToAbsolute(absoluteTime1: AbsoluteTime; absoluteTime2: AbsoluteTime): AbsoluteTime; C;
  94. FUNCTION SubAbsoluteFromAbsolute(leftAbsoluteTime: AbsoluteTime; rightAbsoluteTime: AbsoluteTime): AbsoluteTime; C;
  95. FUNCTION AddNanosecondsToAbsolute(nanoseconds: Nanoseconds; absoluteTime: AbsoluteTime): AbsoluteTime; C;
  96. FUNCTION AddDurationToAbsolute(duration: Duration; absoluteTime: AbsoluteTime): AbsoluteTime; C;
  97. FUNCTION SubNanosecondsFromAbsolute(nanoseconds: Nanoseconds; absoluteTime: AbsoluteTime): AbsoluteTime; C;
  98. FUNCTION SubDurationFromAbsolute(duration: Duration; absoluteTime: AbsoluteTime): AbsoluteTime; C;
  99. FUNCTION AbsoluteDeltaToNanoseconds(leftAbsoluteTime: AbsoluteTime; rightAbsoluteTime: AbsoluteTime): Nanoseconds; C;
  100. FUNCTION AbsoluteDeltaToDuration(leftAbsoluteTime: AbsoluteTime; rightAbsoluteTime: AbsoluteTime): Duration; C;
  101. FUNCTION DurationToNanoseconds(theDuration: Duration): Nanoseconds; C;
  102. FUNCTION NanosecondsToDuration(theNanoseconds: Nanoseconds): Duration; C;
  103. FUNCTION CompareAndSwap(oldVvalue: UInt32; newValue: UInt32; VAR OldValueAdr: UInt32): BOOLEAN; C;
  104. FUNCTION TestAndSet(bit: UInt32; VAR startAddress: UInt8): BOOLEAN; C;
  105. FUNCTION TestAndClear(bit: UInt32; VAR startAddress: UInt8): BOOLEAN; C;
  106. FUNCTION IncrementAtomic(VAR value: SInt32): SInt32; C;
  107. FUNCTION DecrementAtomic(VAR value: SInt32): SInt32; C;
  108. FUNCTION AddAtomic(amount: SInt32; VAR value: SInt32): SInt32; C;
  109. FUNCTION BitAndAtomic(mask: UInt32; VAR value: UInt32): UInt32; C;
  110. FUNCTION BitOrAtomic(mask: UInt32; VAR value: UInt32): UInt32; C;
  111. FUNCTION BitXorAtomic(mask: UInt32; VAR value: UInt32): UInt32; C;
  112. FUNCTION IncrementAtomic8(VAR value: SInt8): SInt8; C;
  113. FUNCTION DecrementAtomic8(VAR value: SInt8): SInt8; C;
  114. FUNCTION AddAtomic8(amount: SInt32; VAR value: SInt8): SInt8; C;
  115. FUNCTION BitAndAtomic8(mask: UInt32; VAR value: UInt8): ByteParameter; C;
  116. FUNCTION BitOrAtomic8(mask: UInt32; VAR value: UInt8): ByteParameter; C;
  117. FUNCTION BitXorAtomic8(mask: UInt32; VAR value: UInt8): ByteParameter; C;
  118. FUNCTION IncrementAtomic16(VAR value: SInt16): SInt16; C;
  119. FUNCTION DecrementAtomic16(VAR value: SInt16): SInt16; C;
  120. FUNCTION AddAtomic16(amount: SInt32; VAR value: SInt16): SInt16; C;
  121. FUNCTION BitAndAtomic16(mask: UInt32; VAR value: UInt16): UInt16; C;
  122. FUNCTION BitOrAtomic16(mask: UInt32; VAR value: UInt16): UInt16; C;
  123. FUNCTION BitXorAtomic16(mask: UInt32; VAR value: UInt16): UInt16; C;
  124. FUNCTION PBQueueInit(qHeader: QHdrPtr): OSErr; C;
  125. FUNCTION PBQueueCreate(VAR qHeader: QHdrPtr): OSErr; C;
  126. FUNCTION PBQueueDelete(qHeader: QHdrPtr): OSErr; C;
  127. PROCEDURE PBEnqueue(qElement: QElemPtr; qHeader: QHdrPtr); C;
  128. FUNCTION PBEnqueueLast(qElement: QElemPtr; qHeader: QHdrPtr): OSErr; C;
  129. FUNCTION PBDequeue(qElement: QElemPtr; qHeader: QHdrPtr): OSErr; C;
  130. FUNCTION PBDequeueFirst(qHeader: QHdrPtr; VAR theFirstqElem: QElemPtr): OSErr; C;
  131. FUNCTION PBDequeueLast(qHeader: QHdrPtr; VAR theLastqElem: QElemPtr): OSErr; C;
  132. FUNCTION CStrCopy(dst: CStringPtr; src: ConstCStringPtr): CStringPtr; C;
  133. FUNCTION PStrCopy(dst: StringPtr; src: Str255): StringPtr; C;
  134. FUNCTION CStrNCopy(dst: CStringPtr; src: ConstCStringPtr; max: UInt32): CStringPtr; C;
  135. FUNCTION PStrNCopy(dst: StringPtr; src: Str255; max: UInt32): StringPtr; C;
  136. FUNCTION CStrCat(dst: CStringPtr; src: ConstCStringPtr): CStringPtr; C;
  137. FUNCTION PStrCat(dst: StringPtr; src: Str255): StringPtr; C;
  138. FUNCTION CStrNCat(dst: CStringPtr; src: ConstCStringPtr; max: UInt32): CStringPtr; C;
  139. FUNCTION PStrNCat(dst: StringPtr; src: Str255; max: UInt32): StringPtr; C;
  140. PROCEDURE PStrToCStr(dst: CStringPtr; src: Str255); C;
  141. PROCEDURE CStrToPStr(VAR dst: Str255; src: ConstCStringPtr); C;
  142. FUNCTION CStrCmp(s1: ConstCStringPtr; s2: ConstCStringPtr): SInt16; C;
  143. FUNCTION PStrCmp(str1: Str255; str2: Str255): SInt16; C;
  144. FUNCTION CStrNCmp(s1: ConstCStringPtr; s2: ConstCStringPtr; max: UInt32): SInt16; C;
  145. FUNCTION PStrNCmp(str1: Str255; str2: Str255; max: UInt32): SInt16; C;
  146. FUNCTION CStrLen(src: ConstCStringPtr): UInt32; C;
  147. FUNCTION PStrLen(src: Str255): UInt32; C;
  148. FUNCTION DeviceProbe(theSrc: UNIV Ptr; theDest: UNIV Ptr; AccessType: UInt32): OSStatus; C;
  149. FUNCTION DelayForHardware(absoluteTime: AbsoluteTime): OSStatus; C;
  150. {$ALIGN RESET}
  151. {$POP}
  152.  
  153. {$SETC UsingIncludes := DriverServicesIncludes}
  154.  
  155. {$ENDC} {__DRIVERSERVICES__}
  156.  
  157. {$IFC NOT UsingIncludes}
  158.  END.
  159. {$ENDC}
  160.